package com.bainuo.doctor.common.widget.viewloader;

import android.content.Context;
import android.util.AttributeSet;
import android.view.ViewTreeObserver;
import android.widget.TextView;

import com.bainuo.doctor.common.util.ViewUtil;

/**
 * Created by bainuo on 2017/2/9.
 */

public class BNCountView extends android.support.v7.widget.AppCompatTextView {


    public BNCountView(Context context) {
        super(context);
        init(context);
    }

    public BNCountView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init(context);
    }

    public void init(Context context) {
        getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
            @Override
            public void onGlobalLayout() {
                ViewUtil.setCorner(BNCountView.this, getHeight() / 2, "#ff0000");
            }
        });
    }
}
